package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.hmo.mall.utils.SpUtil;
import xhwl.retrofitrx.BaseApi;

/**
 * 获取订单详情页面
 */

public class GetOrderDetailApi extends BaseApi {
    GetOrderDetailReq req;
    public GetOrderDetailApi(String order_id){
        req=new GetOrderDetailReq(order_id);
        setShowDialog(true);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getOrderDetail(requestBody);
    }
    public static class GetOrderDetailReq {

        /**
         * member_mobile : 13292786298
         * goods_type : goods_type / /商品类别 1健康套装系列 2重疾卡系列 3HMO卡系列 0设备
         * order_id : 255655
         */

        private String member_mobile;
        private String order_id;

        public GetOrderDetailReq(String order_id) {
            this.member_mobile = SpUtil.getString(SpUtil.MEMBER_MOBILE,"");
            this.order_id = order_id;
        }
    }
}
